/**
 * CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

package com.cmcc.zysoft.infocollection.mobile.dao;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.cmcc.zysoft.infocollection.model.Areas;
import com.starit.common.dao.hibernate.HibernateBaseDaoImpl;

/**
 * @author 袁凤建
 * <br />邮箱: yuan.fengjian@ustcinfo.com
 * <br />描述: MAreasDao.java
 * <br />版本: 1.0.0
 * <br />日期: 2013-8-16 上午11:06:07
 * <br />CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

@Repository
public class MAreasDao extends HibernateBaseDaoImpl<Areas, Integer> {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	/**
	 * 根据区域ID查找区域信息.
	 * @param areaId 区域ID
	 * @return list
	 */
	public Areas getAreaById(String areaId) {
		List<Areas> list = this.findByNamedParam(new String[]{"areaid"}, new Object[]{areaId});
		if(!list.isEmpty()) {
			return list.get(0);
		}
		return null;
	}
}